home *** CD-ROM | disk | FTP | other *** search
- Path: news.cyberport.com!usenet
- From: tangent@cyberport.com (Warren Young)
- Newsgroups: comp.lang.c++,rec.games.programmer,alt.msdos.programmer,comp.programming
- Subject: Re: Young programmers read me.
- Date: Mon, 15 Apr 1996 22:37:41 GMT
- Organization: none
- Message-ID: <3172cdaa.443346438@news.cyberport.com>
- References: <4icpp9$7hr@barad-dur.nas.com> <4imqe4$cj3@ping1.ping.be> <1996Mar23.224853.116513@kuhub.cc.ukans.edu> <4j52hn$ikb@news.ios.com> <Pine.OSF.3.91.960403112207.17337H-100000@bud.cc.swin.edu.au> <aidan-0404961557290001@meathook.intac.com> <pnoguchi-0404962135210001@pnoguchi.his.com> <aidan-0604961847480001@meathook.intac.com> <316a2987.3677177@news.cyberport.com> <316C722E.528A@his.com>
- NNTP-Posting-Host: ppp15.cyberport.com
- X-Newsreader: Forte Agent .99d/32.182
-
- Tom Daniels <tdaniels@his.com> wrote:
-
- >> such. Could you, for example, assign a raw address to the Oberon
- >> sample? You can in C/C++, because they're directly analogous to the
- >> underlying machine structures.
- >
- >My question is this: If you are writing non system type programs
- >(I include games in this category), why in the world would you
- >ever resort to such a hack as to assign a raw address to a function
- >pointer. It's that sort of crap (that is easy to do even by
- >accident) that C is infamous for. As a program manager heading a
- >project, I would shoot at dawn, the first programmer who pulled this
- >kind of crap. If you gotta do that stuff, you've misdesigned
- >your program structure somewhere.
-
- You're right, the only sane time to do something like this is when
- you're using C to get at hardware structures. I used to use it all
- the time to get at BIOS and video stuff, because there really was no
- other way to do it. Plus, if all this is hidden away in a library
- somewhere, it doesn't much impact the maintainability of the program.
- After all, such low-level libraries rarely change, if done right.
-
- Now if you're using it to do calculated jumps into the middle of your
- code, yes, string `em up by their small toes and jerk on the cord
- until they break off. Repeat until no toes left. Then give them an
- assembler, which is what they really wanted in the first place.
-
- Okay, so now let's say you're not doing anything that needs low-level
- hardware access. Does that mean C is a bad choice? Well, maybe, but
- not for that reason. You simply don't use the tool.
-
- I just did a small computer repair job today -- I brought along my
- suitcase-sized toolkit, but only used some gender menders, a
- screwdriver and a nutdriver. Does that mean my toolkit is bad because
- it has a lot of stuff that was completely useless to me on this job?
- No, I just ignored the tools I didn't need just then. Among them was
- an X-Acto knife, a very dangerous tool to be using around computers.
- Is the toolkit too dangerous to use? No, because I wasn't using that
- tool, and if I was, I would use due caution.
-
- Sure, the analogy isn't perfect, but I think it makes the point.
-
- = Warren --
-